package org.lsj.kit.config.SpringSecurityImpl;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * Created by 豆腐干Sama on 2019/3/4.
 */
public class KitUserDetails extends User{
    private org.lsj.kit.model.User user;
    private List<Map<String,Object>> permTree;
    private Map<Integer,List<String>> buttonMap;

    public KitUserDetails(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public KitUserDetails(org.lsj.kit.model.User  user, String username, String password, boolean enabled, boolean accountNonExpired,
                           boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities, List<Map<String,Object>> permTree, Map<Integer,List<String>> buttonMap) {
        super(username,password,enabled,accountNonExpired,credentialsNonExpired,accountNonLocked,authorities);
        this.user = user;
        this.permTree=permTree;
        this.buttonMap=buttonMap;
    }

    public org.lsj.kit.model.User getUser() {
        return user;
    }

    public void setUser(org.lsj.kit.model.User user) {
        this.user = user;
    }

    public List<Map<String, Object>> getPermTree() {
        return permTree;
    }

    public void setPermTree(List<Map<String, Object>> permTree) {
        this.permTree = permTree;
    }

    public Map<Integer, List<String>> getButtonMap() {
        return buttonMap;
    }

    public void setButtonMap(Map<Integer, List<String>> buttonMap) {
        this.buttonMap = buttonMap;
    }
}
